3.12.20 \(\int \frac {(a+i a \tan (e+f x))^2}{\sqrt {c+d \tan (e+f x)}} \, dx\) [1120]

3.12.20.1 Optimal result
3.12.20.2 Mathematica [A] (verified)
3.12.20.3 Rubi [A] (warning: unable to verify)
3.12.20.4 Maple [B] (verified)
3.12.20.5 Fricas [B] (verification not implemented)
3.12.20.6 Sympy [F]
3.12.20.7 Maxima [F]
3.12.20.8 Giac [B] (verification not implemented)
3.12.20.9 Mupad [B] (verification not implemented)

3.12.20.1 Optimal result

Integrand size = 30, antiderivative size = 74 \[ \int \frac {(a+i a \tan (e+f x))^2}{\sqrt {c+d \tan (e+f x)}} \, dx=-\frac {4 i a^2 \text {arctanh}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{\sqrt {c-i d} f}-\frac {2 a^2 \sqrt {c+d \tan (e+f x)}}{d f} \]

output
-4*I*a^2*arctanh((c+d*tan(f*x+e))^(1/2)/(c-I*d)^(1/2))/f/(c-I*d)^(1/2)-2*a 
^2*(c+d*tan(f*x+e))^(1/2)/d/f
 
3.12.20.2 Mathematica [A] (verified)

Time = 1.46 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.95 \[ \int \frac {(a+i a \tan (e+f x))^2}{\sqrt {c+d \tan (e+f x)}} \, dx=\frac {2 a^2 \left (-\frac {2 i \text {arctanh}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{\sqrt {c-i d}}-\frac {\sqrt {c+d \tan (e+f x)}}{d}\right )}{f} \]

input
Integrate[(a + I*a*Tan[e + f*x])^2/Sqrt[c + d*Tan[e + f*x]],x]
 
output
(2*a^2*(((-2*I)*ArcTanh[Sqrt[c + d*Tan[e + f*x]]/Sqrt[c - I*d]])/Sqrt[c - 
I*d] - Sqrt[c + d*Tan[e + f*x]]/d))/f
 
3.12.20.3 Rubi [A] (warning: unable to verify)

Time = 0.44 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.97, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {3042, 4026, 3042, 4020, 25, 27, 73, 221}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(a+i a \tan (e+f x))^2}{\sqrt {c+d \tan (e+f x)}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a+i a \tan (e+f x))^2}{\sqrt {c+d \tan (e+f x)}}dx\)

\(\Big \downarrow \) 4026

\(\displaystyle -\frac {2 a^2 \sqrt {c+d \tan (e+f x)}}{d f}+\int \frac {2 i \tan (e+f x) a^2+2 a^2}{\sqrt {c+d \tan (e+f x)}}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {2 a^2 \sqrt {c+d \tan (e+f x)}}{d f}+\int \frac {2 i \tan (e+f x) a^2+2 a^2}{\sqrt {c+d \tan (e+f x)}}dx\)

\(\Big \downarrow \) 4020

\(\displaystyle -\frac {2 a^2 \sqrt {c+d \tan (e+f x)}}{d f}+\frac {4 i a^4 \int -\frac {1}{\sqrt {2} a^2 \left (2 a^2-2 i a^2 \tan (e+f x)\right ) \sqrt {2 c+2 d \tan (e+f x)}}d\left (2 i a^2 \tan (e+f x)\right )}{f}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {2 a^2 \sqrt {c+d \tan (e+f x)}}{d f}-\frac {4 i a^4 \int \frac {1}{\sqrt {2} a^2 \left (2 a^2-2 i a^2 \tan (e+f x)\right ) \sqrt {2 c+2 d \tan (e+f x)}}d\left (2 i a^2 \tan (e+f x)\right )}{f}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {2 a^2 \sqrt {c+d \tan (e+f x)}}{d f}-\frac {2 i \sqrt {2} a^2 \int \frac {1}{\left (2 a^2-2 i a^2 \tan (e+f x)\right ) \sqrt {2 c+2 d \tan (e+f x)}}d\left (2 i a^2 \tan (e+f x)\right )}{f}\)

\(\Big \downarrow \) 73

\(\displaystyle -\frac {2 a^2 \sqrt {c+d \tan (e+f x)}}{d f}+\frac {4 \sqrt {2} a^4 \int \frac {1}{\frac {4 i \tan ^2(e+f x) a^6}{d}+\frac {2 (i c+d) a^2}{d}}d\sqrt {2 c+2 d \tan (e+f x)}}{d f}\)

\(\Big \downarrow \) 221

\(\displaystyle -\frac {2 a^2 \sqrt {c+d \tan (e+f x)}}{d f}+\frac {4 a^2 \arctan \left (\frac {\sqrt {2} a^2 \tan (e+f x)}{\sqrt {c-i d}}\right )}{f \sqrt {c-i d}}\)

input
Int[(a + I*a*Tan[e + f*x])^2/Sqrt[c + d*Tan[e + f*x]],x]
 
output
(4*a^2*ArcTan[(Sqrt[2]*a^2*Tan[e + f*x])/Sqrt[c - I*d]])/(Sqrt[c - I*d]*f) 
 - (2*a^2*Sqrt[c + d*Tan[e + f*x]])/(d*f)
 

3.12.20.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, x]
 

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4020
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[c*(d/f)   Subst[Int[(a + (b/d)*x)^m/(d^2 + 
c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[ 
b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]
 

rule 4026
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^2, x_Symbol] :> Simp[d^2*((a + b*Tan[e + f*x])^(m + 1)/(b*f*( 
m + 1))), x] + Int[(a + b*Tan[e + f*x])^m*Simp[c^2 - d^2 + 2*c*d*Tan[e + f* 
x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] &&  !LeQ 
[m, -1] &&  !(EqQ[m, 2] && EqQ[a, 0])
 
3.12.20.4 Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 765 vs. \(2 (63 ) = 126\).

Time = 0.71 (sec) , antiderivative size = 766, normalized size of antiderivative = 10.35

method result size
derivativedivides \(\frac {2 a^{2} \left (-\sqrt {c +d \tan \left (f x +e \right )}-2 d \left (\frac {\frac {\left (i \sqrt {c^{2}+d^{2}}+i c -d \right ) \ln \left (d \tan \left (f x +e \right )+c +\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d -\frac {\left (i \sqrt {c^{2}+d^{2}}+i c -d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}}+\frac {-\frac {\left (2 i c^{2} \sqrt {c^{2}+d^{2}}+i d^{2} \sqrt {c^{2}+d^{2}}+2 i c^{3}+2 i c \,d^{2}-c d \sqrt {c^{2}+d^{2}}-c^{2} d -d^{3}\right ) \ln \left (\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-d \tan \left (f x +e \right )-c -\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}\, c^{2}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{3}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c \,d^{2}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}\, c d +\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2} d +\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{3}+\frac {\left (2 i c^{2} \sqrt {c^{2}+d^{2}}+i d^{2} \sqrt {c^{2}+d^{2}}+2 i c^{3}+2 i c \,d^{2}-c d \sqrt {c^{2}+d^{2}}-c^{2} d -d^{3}\right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-2 \sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}\, \left (\sqrt {c^{2}+d^{2}}\, c +c^{2}+d^{2}\right )}\right )\right )}{f d}\) \(766\)
default \(\frac {2 a^{2} \left (-\sqrt {c +d \tan \left (f x +e \right )}-2 d \left (\frac {\frac {\left (i \sqrt {c^{2}+d^{2}}+i c -d \right ) \ln \left (d \tan \left (f x +e \right )+c +\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d -\frac {\left (i \sqrt {c^{2}+d^{2}}+i c -d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}}+\frac {-\frac {\left (2 i c^{2} \sqrt {c^{2}+d^{2}}+i d^{2} \sqrt {c^{2}+d^{2}}+2 i c^{3}+2 i c \,d^{2}-c d \sqrt {c^{2}+d^{2}}-c^{2} d -d^{3}\right ) \ln \left (\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-d \tan \left (f x +e \right )-c -\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}\, c^{2}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{3}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c \,d^{2}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}\, c d +\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2} d +\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{3}+\frac {\left (2 i c^{2} \sqrt {c^{2}+d^{2}}+i d^{2} \sqrt {c^{2}+d^{2}}+2 i c^{3}+2 i c \,d^{2}-c d \sqrt {c^{2}+d^{2}}-c^{2} d -d^{3}\right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}-2 \sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}\, \left (\sqrt {c^{2}+d^{2}}\, c +c^{2}+d^{2}\right )}\right )\right )}{f d}\) \(766\)
parts \(\text {Expression too large to display}\) \(3486\)

input
int((a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e))^(1/2),x,method=_RETURNVERBOSE)
 
output
2/f*a^2/d*(-(c+d*tan(f*x+e))^(1/2)-2*d*(1/2/(2*(c^2+d^2)^(1/2)+2*c)^(1/2)/ 
(c^2+d^2)^(1/2)*(1/2*(I*(c^2+d^2)^(1/2)+I*c-d)*ln(d*tan(f*x+e)+c+(c+d*tan( 
f*x+e))^(1/2)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)+(c^2+d^2)^(1/2))+2*(I*(2*(c^2+ 
d^2)^(1/2)+2*c)^(1/2)*c-(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*d-1/2*(I*(c^2+d^2)^( 
1/2)+I*c-d)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)*a 
rctan((2*(c+d*tan(f*x+e))^(1/2)+(2*(c^2+d^2)^(1/2)+2*c)^(1/2))/(2*(c^2+d^2 
)^(1/2)-2*c)^(1/2)))+1/2/(2*(c^2+d^2)^(1/2)+2*c)^(1/2)/(c^2+d^2)^(1/2)/((c 
^2+d^2)^(1/2)*c+c^2+d^2)*(-1/2*(2*I*(c^2+d^2)^(1/2)*c^2+I*d^2*(c^2+d^2)^(1 
/2)+2*I*c^3+2*I*c*d^2-c*d*(c^2+d^2)^(1/2)-c^2*d-d^3)*ln((c+d*tan(f*x+e))^( 
1/2)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)-d*tan(f*x+e)-c-(c^2+d^2)^(1/2))+2*(-I*( 
2*(c^2+d^2)^(1/2)+2*c)^(1/2)*(c^2+d^2)^(1/2)*c^2-I*(2*(c^2+d^2)^(1/2)+2*c) 
^(1/2)*c^3-I*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c*d^2+(2*(c^2+d^2)^(1/2)+2*c)^( 
1/2)*(c^2+d^2)^(1/2)*c*d+(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c^2*d+(2*(c^2+d^2)^ 
(1/2)+2*c)^(1/2)*d^3+1/2*(2*I*(c^2+d^2)^(1/2)*c^2+I*d^2*(c^2+d^2)^(1/2)+2* 
I*c^3+2*I*c*d^2-c*d*(c^2+d^2)^(1/2)-c^2*d-d^3)*(2*(c^2+d^2)^(1/2)+2*c)^(1/ 
2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)*arctan(((2*(c^2+d^2)^(1/2)+2*c)^(1/2)-2* 
(c+d*tan(f*x+e))^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)))))
 
3.12.20.5 Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 341 vs. \(2 (60) = 120\).

Time = 0.24 (sec) , antiderivative size = 341, normalized size of antiderivative = 4.61 \[ \int \frac {(a+i a \tan (e+f x))^2}{\sqrt {c+d \tan (e+f x)}} \, dx=\frac {d \sqrt {-\frac {16 i \, a^{4}}{{\left (i \, c + d\right )} f^{2}}} f \log \left (\frac {{\left (4 \, a^{2} c + {\left ({\left (i \, c + d\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (i \, c + d\right )} f\right )} \sqrt {-\frac {16 i \, a^{4}}{{\left (i \, c + d\right )} f^{2}}} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} + 4 \, {\left (a^{2} c - i \, a^{2} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a^{2}}\right ) - d \sqrt {-\frac {16 i \, a^{4}}{{\left (i \, c + d\right )} f^{2}}} f \log \left (\frac {{\left (4 \, a^{2} c + {\left ({\left (-i \, c - d\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-i \, c - d\right )} f\right )} \sqrt {-\frac {16 i \, a^{4}}{{\left (i \, c + d\right )} f^{2}}} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} + 4 \, {\left (a^{2} c - i \, a^{2} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a^{2}}\right ) - 8 \, a^{2} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}}{4 \, d f} \]

input
integrate((a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e))^(1/2),x, algorithm="fricas 
")
 
output
1/4*(d*sqrt(-16*I*a^4/((I*c + d)*f^2))*f*log(1/2*(4*a^2*c + ((I*c + d)*f*e 
^(2*I*f*x + 2*I*e) + (I*c + d)*f)*sqrt(-16*I*a^4/((I*c + d)*f^2))*sqrt(((c 
 - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1)) + 4*(a^2 
*c - I*a^2*d)*e^(2*I*f*x + 2*I*e))*e^(-2*I*f*x - 2*I*e)/a^2) - d*sqrt(-16* 
I*a^4/((I*c + d)*f^2))*f*log(1/2*(4*a^2*c + ((-I*c - d)*f*e^(2*I*f*x + 2*I 
*e) + (-I*c - d)*f)*sqrt(-16*I*a^4/((I*c + d)*f^2))*sqrt(((c - I*d)*e^(2*I 
*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1)) + 4*(a^2*c - I*a^2*d)* 
e^(2*I*f*x + 2*I*e))*e^(-2*I*f*x - 2*I*e)/a^2) - 8*a^2*sqrt(((c - I*d)*e^( 
2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1)))/(d*f)
 
3.12.20.6 Sympy [F]

\[ \int \frac {(a+i a \tan (e+f x))^2}{\sqrt {c+d \tan (e+f x)}} \, dx=- a^{2} \left (\int \frac {\tan ^{2}{\left (e + f x \right )}}{\sqrt {c + d \tan {\left (e + f x \right )}}}\, dx + \int \left (- \frac {2 i \tan {\left (e + f x \right )}}{\sqrt {c + d \tan {\left (e + f x \right )}}}\right )\, dx + \int \left (- \frac {1}{\sqrt {c + d \tan {\left (e + f x \right )}}}\right )\, dx\right ) \]

input
integrate((a+I*a*tan(f*x+e))**2/(c+d*tan(f*x+e))**(1/2),x)
 
output
-a**2*(Integral(tan(e + f*x)**2/sqrt(c + d*tan(e + f*x)), x) + Integral(-2 
*I*tan(e + f*x)/sqrt(c + d*tan(e + f*x)), x) + Integral(-1/sqrt(c + d*tan( 
e + f*x)), x))
 
3.12.20.7 Maxima [F]

\[ \int \frac {(a+i a \tan (e+f x))^2}{\sqrt {c+d \tan (e+f x)}} \, dx=\int { \frac {{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{2}}{\sqrt {d \tan \left (f x + e\right ) + c}} \,d x } \]

input
integrate((a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e))^(1/2),x, algorithm="maxima 
")
 
output
integrate((I*a*tan(f*x + e) + a)^2/sqrt(d*tan(f*x + e) + c), x)
 
3.12.20.8 Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 182 vs. \(2 (60) = 120\).

Time = 0.55 (sec) , antiderivative size = 182, normalized size of antiderivative = 2.46 \[ \int \frac {(a+i a \tan (e+f x))^2}{\sqrt {c+d \tan (e+f x)}} \, dx=-\frac {2 \, \sqrt {d \tan \left (f x + e\right ) + c} a^{2}}{d f} + \frac {8 i \, a^{2} \arctan \left (\frac {2 \, {\left (\sqrt {d \tan \left (f x + e\right ) + c} c - \sqrt {c^{2} + d^{2}} \sqrt {d \tan \left (f x + e\right ) + c}\right )}}{c \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} - i \, \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} d - \sqrt {c^{2} + d^{2}} \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}}}\right )}{\sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} f {\left (-\frac {i \, d}{c - \sqrt {c^{2} + d^{2}}} + 1\right )}} \]

input
integrate((a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e))^(1/2),x, algorithm="giac")
 
output
-2*sqrt(d*tan(f*x + e) + c)*a^2/(d*f) + 8*I*a^2*arctan(2*(sqrt(d*tan(f*x + 
 e) + c)*c - sqrt(c^2 + d^2)*sqrt(d*tan(f*x + e) + c))/(c*sqrt(-2*c + 2*sq 
rt(c^2 + d^2)) - I*sqrt(-2*c + 2*sqrt(c^2 + d^2))*d - sqrt(c^2 + d^2)*sqrt 
(-2*c + 2*sqrt(c^2 + d^2))))/(sqrt(-2*c + 2*sqrt(c^2 + d^2))*f*(-I*d/(c - 
sqrt(c^2 + d^2)) + 1))
 
3.12.20.9 Mupad [B] (verification not implemented)

Time = 6.15 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.91 \[ \int \frac {(a+i a \tan (e+f x))^2}{\sqrt {c+d \tan (e+f x)}} \, dx=-\frac {2\,a^2\,\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{d\,f}+\frac {a^2\,\mathrm {atan}\left (\frac {\sqrt {c+d\,\mathrm {tan}\left (e+f\,x\right )}}{\sqrt {-c+d\,1{}\mathrm {i}}}\right )\,4{}\mathrm {i}}{f\,\sqrt {-c+d\,1{}\mathrm {i}}} \]

input
int((a + a*tan(e + f*x)*1i)^2/(c + d*tan(e + f*x))^(1/2),x)
 
output
(a^2*atan((c + d*tan(e + f*x))^(1/2)/(d*1i - c)^(1/2))*4i)/(f*(d*1i - c)^( 
1/2)) - (2*a^2*(c + d*tan(e + f*x))^(1/2))/(d*f)